package com.shengyuan.manage_os.old.ying.erpm;

import com.shengyuan.manage_os.R;
import com.shengyuan.manage_os.old.ying.erpm.tasks.Submit_System_Setting_Data_Task;
import com.shengyuan.manage_os.old.ying.erpm.util.Utility;
import android.os.Bundle;
import android.view.View;

public class Actual_Form_ZhuangDi extends BaseActivity {


	@Override
	public void onClick(View view) {
		super.onClick(view);
	}
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.actual_form_zhuangdi);
		InitControls();
	}

	@Override
	protected void SaveJsonData() {
		try {
			IsJson1 = true; mFinished = 1;
			JsonMyID();
			getCar();
			getZhuangdi();
			//getXiedi();
			getTask();
			getCaiLiao();
			
			getGPS();
			getCurrentUser();
			getMemo();
			JsonPicture();
			
			//价格保存
			if (Submit_System_Setting_Data_Task.mID>=0) {
				String YuSuanJiaGe = Submit_System_Setting_Data_Task.J_GONGCHENGMINGCHENG_GC.getJSONObject(Submit_System_Setting_Data_Task.mID).getString("YuSuanJiaGe");
				String CaiLiaoJiaGe = Submit_System_Setting_Data_Task.J_GONGCHENGMINGCHENG_GC.getJSONObject(Submit_System_Setting_Data_Task.mID).getString("CaiLiaoJiaGe");
				String XieDi = Submit_System_Setting_Data_Task.J_GONGCHENGMINGCHENG_GC.getJSONObject(Submit_System_Setting_Data_Task.mID).getString("XieDi");
				mJson.put( getString(R.string.title_actual_form_jiage),  YuSuanJiaGe);
				mJson.put( getString(R.string.title_actual_form_yusuanjiage),  YuSuanJiaGe);
				mJson.put( getString(R.string.title_actual_form_cailiaojiage),  CaiLiaoJiaGe);
				mJson.put( getString(R.string.title_actual_form_editText_xiedi),  XieDi);
			}
		}catch (Exception e) {
		}
	}
	
	@Override
	protected void SaveSelfPic(String sPath) {
		try {
			CopyPicDest(PictureButton_Car, sPath);
			CopyPicDest(PictureButton_Chexing, sPath);
			CopyPicDest(PictureButton_CaiLiao, sPath);
		} catch (Exception e) {
			Utility.MessageBox(this,e.getMessage());
		}
	}

	@Override
	public void Back() {
		super.Back();
	}

	@Override
	public void InitControls() {
		super.InitControls();
	}
	@Override
	public Boolean IsPassed() {
		if (super.IsPassed()) {
			if (!PictureButton_Car.IsExist()) {
				Utility.MessageBox(this, PictureButton_Car.FIELD );
				return false;
			}
			if (!PictureButton_Chexing.IsExist()) {
				Utility.MessageBox(this, PictureButton_Chexing.FIELD );
				return false;
			}		
			if (!PictureButton_CaiLiao.IsExist()) {
				Utility.MessageBox(this, PictureButton_CaiLiao.FIELD );
				return false;
			}
			return true;
		}else {
			return false;
		}
	}

}
